<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"> 

<head>
</head>
<body>
<ui:composition template="/templates/template.xhtml">
	<ui:define name="title">Cassandraview main page</ui:define>
	<ui:define name="body">
		<a4j:outputPanel layout="block" style="margin-left: 10px;" ajaxRendered="true">
			<rich:messages />
			<h:outputText value="#{queryPage.columnFamily}" />
			<rich:collapsiblePanel switchType="client">
				<table>
					<tr>
						<td><h:outputText value="Query limit" /></td>
						<td>
							<rich:inputNumberSlider value="#{queryPage.limit}" maxValue="1000" label="Query limit" >
								<a4j:ajax render="out"/>
							</rich:inputNumberSlider>							
						</td>
					</tr>
				</table>
			</rich:collapsiblePanel>
			<rich:dataTable style="width:100%;" value="#{queryPage.columns}" var="list" rendered="#{not empty queryPage.columnFamily}">
	            <f:facet name="header">
	                <rich:columnGroup>
	                    <rich:column colspan="4">
	                        <h:outputText value="Query results" />
	                    </rich:column>
	                    <rich:column breakRowBefore="true">
	                        <h:outputText value="Name" />
	                    </rich:column>
	                    <rich:column>
	                        <h:outputText value="Value" />
	                    </rich:column>
	                    <rich:column>
	                        <h:outputText value="Timestamp" />
	                    </rich:column>
	                    <rich:column>
	                        <h:outputText value="TTL" />
	                    </rich:column>
	                </rich:columnGroup>
	            </f:facet>
	            <rich:column colspan="4">
	                <rich:collapsibleSubTableToggler for="sbtbl" />
	                <h:outputText value="#{list.key}" />
	            </rich:column>
	            <rich:collapsibleSubTable value="#{list.columns}" var="item" id="sbtbl">
	                <rich:column>
	                    <h:outputText value="#{item.name}" />
	                </rich:column>
	                <rich:column>
	                    <h:outputText value="#{item.value}" />
	                </rich:column>
	                <rich:column>
	                    <h:outputText value="#{item.timestamp}" />
	                </rich:column>
	                <rich:column>
	                    <h:outputText value="#{item.ttl}" />
	                </rich:column>
	            </rich:collapsibleSubTable>
      	 	</rich:dataTable>
		</a4j:outputPanel>
	</ui:define>
</ui:composition>
</body>
</html>
